<template>
  <van-swipe class="my-swipe" indicator-color="white">
    <template v-for="item in banners">
      <van-swipe-item :key="item.id">
        <img :src="item.url" />
      </van-swipe-item>
    </template>
  </van-swipe>
</template>

<script>
import { getBannerApi } from '@/api/filmApi'
export default {
  data() {
    return {
      banners: [],
    }
  },
  async mounted() {
    let ret = await getBannerApi()
    this.banners = ret
  },
}
</script>

<style lang="scss" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  height: 150px;
  text-align: center;
  /* background-color: #39a9ed; */
  img {
    height: 100%;
    width: 100%;
  }
}
</style>